/******************************************************************
 *
 * 	Programmer:		Brandon Shouse
 * 	Class:			CS362-400
 * 	Assignment:		Assignment 3
 *
 * 	Description: Unit Test for the supplyCount() function
 *
 *****************************************************************/

#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int main() 
{
	struct gameState state;
	int numPlayer = 2;
	int p, r, i, test;
	int seed = 1000;
	int k[10] = {adventurer, council_room, feast, gardens, mine, 
		remodel, smithy, village, baron, great_hall};

	memset(&state, 23, sizeof(struct gameState));
	r = initializeGame(numPlayer, k, seed, &state);

	printf("Testing supplyCount() function...\n");

	//Set supply count for 3 cards, lower limit
	test = 0;	
	state.supplyCount[adventurer] = 10;
	state.supplyCount[council_room] = 20;
	state.supplyCount[baron] = 30;

	assert (supplyCount(adventurer, &state) == 10);
	printf("\tsupplyCount for adventurer: Passed\n");

	assert (supplyCount(council_room, &state) == 20);
	printf("\tsupplyCount for council_room: Passed\n");

	assert (supplyCount(baron, &state) == 30);
	printf("\tsupplyCount for baron: Passed \n");

	//Set supply count to high number for each in k[] and test
	for(i = 0; i < 10; i++)
	{
		state.supplyCount[k[i]] = 1000;
		test = supplyCount(k[i], &state);
		assert (test == 1000);
	}

	printf("\tsupplyCount for 1000 of each card in k[]: Passed\n");
	printf("supplyCount() passed all Tests...\n");

	return 0;
}
